import React, { Component } from 'react'

import './css/index.css'
import FilmList from './FilmList'

export default class App extends Component {
  state = {
    type: 1,
  }

  render() {
    return (
      <>
        <ul className='navbar'>
          <li
            className={this.state.type === 1 ? 'active' : ''}
            onClick={() => this.setState({ type: 1 })}
          >
            正在热映
          </li>
          <li
            className={this.state.type === 2 ? 'active' : ''}
            onClick={() => this.setState({ type: 2 })}
          >
            即将热映
          </li>
        </ul>
        <FilmList type={this.state.type}></FilmList>
      </>
    )
  }
}
